<template>
  <div class="navbar" :style="{ backgroundColor: bg }">
    <div class="back" @click="onBackClick">
      <SvgIcon iconName="arrow" color="var(--primary-text-color)" size="14px" />
    </div>
    <div class="title">{{ props.title }}</div>
    <slot name="action"></slot>
  </div>
</template>

<script setup lang="ts">
// import { ref, reactive, watch, onMounted } from 'vue'

import { useRouter } from 'vue-router'
const router = useRouter()
console.log(router)

const emit = defineEmits([''])
const props = defineProps({
  bg: {
    type: String,
    default: ''
  },
  title: {
    type: String,
    default: ''
  },
  showSetting: {
    type: Boolean,
    default: false
  }
})
console.log(props)
const onBackClick = () => {
  router.go(-1)
}
</script>
<style lang="less" scoped>
@import url(../assets/style/header.less);
</style>
